<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'doRegister.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    This is my JSP page. <br>
    <%
    	//request.setCharacterEncoding("utf-8");//post的时刻
        String ip=request.getRemoteAddr();
    	//get的时候，setCharacterEncoding没用
    	//自己转换
    	String name=request.getParameter("username");
    	///name=new String(name.getBytes("iso8859-1"),"utf-8");
    	
    	String pass=request.getParameter("pass");
    	String sex=request.getParameter("sex");
    	String pic=request.getParameter("picture");
    	String  age=request.getParameter("age");
    	int a=-1;
    	//int a=Integer.parseInt(age);
    	String[]like=request.getParameterValues("like");
    %>
    <h1>客户端的信息如下：</h1>
    <h1>ip:<%=ip%></h1>
     <h1>照片:<%=pic%></h1>
    <h1>姓名:<%=name%></h1>
    <h1>密码:<%=pass%></h1>
     <h1>性别:<%=sex%></h1>
    <h1>年龄:<%=age%></h1>
	<%
	  if(like==null)
		  out.print("佛喜青年，没有爱好");
	  else{
		  for(String s:like)
			  out.print(s+"&nbsp;");
	  }
	%>
	<h1>注册成功！</h1>
	<%
		/* if(name.length()>6)
		{
			response.sendRedirect("welcome.jsp");//重定向
			
		}
		else{
			request.getRequestDispatcher("fail.jsp").forward(request, response);
		} */
	%>
  </body>
</html>
